package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CwShopUserMapper;
import com.ruoyi.system.domain.CwShopUser;
import com.ruoyi.system.service.ICwShopUserService;

/**
 * 用户管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class CwShopUserServiceImpl implements ICwShopUserService 
{
    @Autowired
    private CwShopUserMapper cwShopUserMapper;
    //根据手机号查询账号
    @Override
    public CwShopUser getByPhoneNumber(String phoneNumber) {
        return cwShopUserMapper.getByPhoneNumber(phoneNumber);
    }

    /**
     * 查询用户管理
     * 
     * @param userId 用户管理主键
     * @return 用户管理
     */
    @Override
    public CwShopUser selectCwShopUserByUserId(Long userId)
    {
        return cwShopUserMapper.selectCwShopUserByUserId(userId);
    }

    /**
     * 查询用户管理列表
     * 
     * @param cwShopUser 用户管理
     * @return 用户管理
     */
    @Override
    public List<CwShopUser> selectCwShopUserList(CwShopUser cwShopUser)
    {
        return cwShopUserMapper.selectCwShopUserList(cwShopUser);
    }

    /**
     * 新增用户管理
     * 
     * @param cwShopUser 用户管理
     * @return 结果
     */
    @Override
    public int insertCwShopUser(CwShopUser cwShopUser)
    {
        cwShopUser.setCreateTime(DateUtils.getNowDate());
        return cwShopUserMapper.insertCwShopUser(cwShopUser);
    }

    /**
     * 修改用户管理
     * 
     * @param cwShopUser 用户管理
     * @return 结果
     */
    @Override
    public int updateCwShopUser(CwShopUser cwShopUser)
    {
        return cwShopUserMapper.updateCwShopUser(cwShopUser);
    }

    /**
     * 批量删除用户管理
     * 
     * @param userIds 需要删除的用户管理主键
     * @return 结果
     */
    @Override
    public int deleteCwShopUserByUserIds(Long[] userIds)
    {
        return cwShopUserMapper.deleteCwShopUserByUserIds(userIds);
    }

    /**
     * 删除用户管理信息
     * 
     * @param userId 用户管理主键
     * @return 结果
     */
    @Override
    public int deleteCwShopUserByUserId(Long userId)
    {
        return cwShopUserMapper.deleteCwShopUserByUserId(userId);
    }
}
